//普通函数类型
export type fnType = (...args: any) => any
export interface fnType2 {
  (...args: any): any
}

//构造函数类型
export type cfnType = new (...args: any) => any
export interface cfnType2 {
  new (...args: any): any
}

function fisrtDecoratorWrapper(params: string) {
  console.log('进入第一个装饰器 参数', params)
  return function fisrtDecorator(targetClass: cfnType2) {
    const _instance = new targetClass()
    console.log('进入第一个装饰器', _instance)
  }
}

@fisrtDecoratorWrapper('abc')
class CustomerService {
  name: string = '11'
  constructor() {
    console.log('装饰器执行了构造函数')
  }

  buy() {
    console.log(this.name + '购买')
  }
  placeOrder() {
    console.log(this.name + '下单')
  }
}

export { CustomerService }
